<template>
	<view>
		<DiscoverBanner v-if="datas.banner" :list="datas.banner.list"></DiscoverBanner>
		<DiscoverItem v-if="datas.today"　:list="datas.today.list" :title="datas.today.selection_title"></DiscoverItem>
		<DiscoverHot v-if="datas.hot"　:list="datas.hot.list" :title="datas.hot.selection_title"></DiscoverHot>
		<DiscoverAlbum v-if="datas.banner" :list="datas.album.list" :title="datas.album.selection_title"></DiscoverAlbum>
		<DiscoverItem v-if="datas.posts"　:list="datas.posts.list" :title="datas.posts.selection_title"></DiscoverItem>
	<uni-load-more status="more"></uni-load-more>
	</view>
</template>

<script>
	import DiscoverItem from '@/components/DiscoverItem/DiscoverItem.vue'
	import DiscoverHot from '@/components/DiscoverHot/DiscoverHot.vue'
	import DiscoverBanner from '@/components/DiscoverBanner/DiscoverBanner.vue'
	import DiscoverAlbum from '@/components/DiscoverAlbum/DiscoverAlbum.vue'
	export default {
		name: "Discover",
		data() {
			return {
				datas: {},
				bannerHeight:null,
			}
		},
		methods: {
			changeIndicatorDots(e) {
				this.indicatorDots = !this.indicatorDots
			},
			changeAutoplay(e) {
				this.autoplay = !this.autoplay
			},
			intervalChange(e) {
				this.interval = e.target.value
			},
			durationChange(e) {
				this.duration = e.target.value
			}
		},
		created() {
			uni.request({
				url: 'https://apis.netstart.cn/vmovier/index',
				success: (res) => {
					this.datas = res.data.data;

				}
			})
		},
		// updated() {
		// 	let h = null;
		// 	let query = uni.createSelectorQuery();
		// 	let bans = query.selectAll('.ban-img');
		// 	// console.log(bans);
		// 	bans.boundingClientRect((res)=> {
		// 		// this.bannerHeight = res[0].height;
		// 	}).exec(function() {
		// 		//上述布局位置信息获取成功后执行的回调函数
		// 	})
		// }
	}
</script>

<style lang="less">
	.auto-img {
		width: 100vw;
		// height: auto;
		display: block;
	}

	/deep/ .uni-swiper-dot {
		width: 30rpx;
		height: 4rpx;
		border-radius: 0;
	}

	/deep/ .uni-swiper-dots-horizontal {
		bottom: 0;
	}

	/deep/ .uni-cover-image {
		height: auto;
	}
</style>
